Apparatuses that measure the three-dimensional shape of objects are widely used in various fields, for example, for inspecting parts in factories in the industrial field or measuring the shape of living organisms in the medical field. In particular, noncontact measurement methods are effective in cases where there is a risk that a target object may be deformed or broken by contact with a measurement apparatus. In such noncontact three-dimensional shape measurement, a scheme is widely used, in which a triangulation method is performed using an image obtained by an image capturing apparatus. For example, P. M. Griffin, L. S. Narashimhan, and S. R. Yee: “GENERATION OF UNIQUELY ENCODED LIGHT PATTERNS FOR RANGE DATA ACQUISITION”, Pattern Recognition, Vol. 25, pp. 609-616 (hereinafter, Literature 1) describes an example in which three-dimensional shape measurement is performed by projecting a dot sequence pattern that is characterized by its color onto an object with a projector and imaging the reflected light with a camera.
The procedure of three-dimensional measurement stated in Literature 1 will be specifically described below. First, a three-color RGB dot sequence in which the color sequence is determined by a two-dimensional code string in conformity with a mathematical rule is projected as a projection pattern image onto an object with a projector. An image of the object onto which the projection pattern image is projected is captured with a camera, and a dot sequence observed in the captured image is picked out as an imaging dot sequence. The sequence of adjacent colors in the picked-out imaging dot sequence is decoded as an imaging code string based on a predetermined code string. Using the mathematical rule of the code string of the projection pattern image, the correspondence between partial code strings of portions contained in the obtained imaging code string and two-dimensional positions on the code string of the projection pattern image is determined. All the possible partial code strings in the imaging code string are picked out, the correspondence between the partial code strings and two-dimensional positions is determined as described above, and three-dimensional positions of individual dots are obtained based on the principle of triangulation. Three-dimensional shape measurement of an object is performed using the above-described procedure.
However, in the above-described conventional example, there is the problem that, depending on the shape of the object, it may not be possible to determine the correspondence with respect to a region of a captured image in which a partial code string of a sufficient size cannot be picked out from the imaging code string, so that three-dimensional shape measurement cannot be performed. Moreover, there is the problem that in a case where a sequence of dots that originally are not adjacent to each other is erroneously picked out from an imaging dot sequence or in the case where a color in the imaging dot sequence is distinguished as a wrong color due to noise or other reasons, the code string will be associated with a wrong two-dimensional position, and inaccurate results of three-dimensional measurement will be output. It is indeed possible to detect such erroneous correspondence by increasing the length of a partial code string used in correspondence determination, but, on the other hand, a problem arises that depending on the shape of the object, the region in which a partial code string cannot be picked out from the imaging code string may increase even more.